package com.cryptoneedle.garden.service.crud.garden.doris;

import com.cryptoneedle.garden.entity.garden.ads.AdsColumn;
import com.cryptoneedle.garden.entity.garden.ads.AdsTable;
import com.cryptoneedle.garden.entity.garden.doris.DorisCatalog;
import com.cryptoneedle.garden.entity.garden.doris.DorisColumn;
import com.cryptoneedle.garden.entity.garden.doris.DorisDatabase;
import com.cryptoneedle.garden.entity.garden.doris.DorisTable;
import com.cryptoneedle.garden.entity.garden.dwd.DwdColumn;
import com.cryptoneedle.garden.entity.garden.dwd.DwdTable;
import com.cryptoneedle.garden.entity.garden.mapping.MappingColumn;
import com.cryptoneedle.garden.entity.garden.mapping.MappingTable;
import com.cryptoneedle.garden.entity.garden.ods.OdsColumn;
import com.cryptoneedle.garden.entity.garden.ods.OdsTable;
import com.cryptoneedle.garden.repository.garden.ads.AdsColumnRepository;
import com.cryptoneedle.garden.repository.garden.ads.AdsTableRepository;
import com.cryptoneedle.garden.repository.garden.doris.DorisCatalogRepository;
import com.cryptoneedle.garden.repository.garden.doris.DorisColumnRepository;
import com.cryptoneedle.garden.repository.garden.doris.DorisDatabaseRepository;
import com.cryptoneedle.garden.repository.garden.doris.DorisTableRepository;
import com.cryptoneedle.garden.repository.garden.dwd.DwdColumnRepository;
import com.cryptoneedle.garden.repository.garden.dwd.DwdTableRepository;
import com.cryptoneedle.garden.repository.garden.mapping.MappingColumnRepository;
import com.cryptoneedle.garden.repository.garden.mapping.MappingJoinRepository;
import com.cryptoneedle.garden.repository.garden.mapping.MappingTableRepository;
import com.cryptoneedle.garden.repository.garden.ods.OdsColumnRepository;
import com.cryptoneedle.garden.repository.garden.ods.OdsColumnTranslateRepository;
import com.cryptoneedle.garden.repository.garden.ods.OdsTableRepository;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>description:  </p>
 *
 * @author CryptoNeedle
 * @date 2025-11-13
 */
@Slf4j
@Service
@Transactional
public class AddDorisService {

    @Autowired
    private FoundDorisService select;
    @Autowired
    private AddDorisService add;
    @Autowired
    private PatchDorisService patch;
    @Autowired
    private SaveDorisService save;
    @Autowired
    private DeleteDorisService delete;

    @Resource
    private DorisCatalogRepository dorisCatalogRepository;
    @Resource
    private DorisDatabaseRepository dorisDatabaseRepository;
    @Resource
    private DorisTableRepository dorisTableRepository;
    @Resource
    private MappingTableRepository mappingTableRepository;
    @Resource
    private OdsTableRepository odsTableRepository;
    @Resource
    private DwdTableRepository dwdTableRepository;
    @Resource
    private AdsTableRepository adsTableRepository;
    @Resource
    private DorisColumnRepository dorisColumnRepository;
    @Resource
    private MappingColumnRepository mappingColumnRepository;
    @Resource
    private OdsColumnRepository odsColumnRepository;
    @Resource
    private DwdColumnRepository dwdColumnRepository;
    @Resource
    private AdsColumnRepository adsColumnRepository;

    @Resource
    private MappingJoinRepository mappingJoinRepository;
    @Resource
    private OdsColumnTranslateRepository odsColumnTranslateRepository;

    /**
     * DorisCatalog
     */
    public void add(DorisCatalog entity) {
        dorisCatalogRepository.save(entity);
    }

    public void dorisCatalogs(List<DorisCatalog> list) {
        dorisCatalogRepository.saveAll(list);
    }

    /**
     * DorisDatabase
     */
    public void add(DorisDatabase entity) {
        dorisDatabaseRepository.save(entity);
    }

    public void dorisDatabases(List<DorisDatabase> list) {
        dorisDatabaseRepository.saveAll(list);
    }

    /**
     * DorisTable
     */
    public void add(DorisTable entity) {
        dorisTableRepository.save(entity);
    }

    public void dorisTables(List<DorisTable> list) {
        dorisTableRepository.saveAll(list);
    }

    /**
     * MappingTable
     */
    public void add(MappingTable entity) {
        mappingTableRepository.save(entity);
    }


    public void mappingTables(List<MappingTable> list) {
        mappingTableRepository.saveAll(list);
    }
    /**
     * OdsTable
     */
    public void add(OdsTable entity) {
        odsTableRepository.save(entity);
    }

    public void odsTables(List<OdsTable> list) {
        odsTableRepository.saveAll(list);
    }

    /**
     * DwdTable
     */
    public void add(DwdTable entity) {
        dwdTableRepository.save(entity);
    }

    public void dwdTables(List<DwdTable> list) {
        dwdTableRepository.saveAll(list);
    }

    /**
     * AdsTable
     */
    public void add(AdsTable entity) {
        adsTableRepository.save(entity);
    }

    public void adsTables(List<AdsTable> list) {
        adsTableRepository.saveAll(list);
    }

    /**
     * DorisColumn
     */
    public void add(DorisColumn entity) {
        dorisColumnRepository.save(entity);
    }

    public void dorisColumns(List<DorisColumn> list) {
        dorisColumnRepository.saveAll(list);
    }

    /**
     * MappingColumn
     */
    public void add(MappingColumn entity) {
        mappingColumnRepository.save(entity);
    }

    public void mappingColumns(List<MappingColumn> list) {
        mappingColumnRepository.saveAll(list);
    }

    /**
     * OdsColumn
     */
    public void add(OdsColumn entity) {
        odsColumnRepository.save(entity);
    }

    public void odsColumns(List<OdsColumn> list) {
        odsColumnRepository.saveAll(list);
    }

    /**
     * DwdColumn
     */
    public void add(DwdColumn entity) {
        dwdColumnRepository.save(entity);
    }

    public void dwdColumns(List<DwdColumn> list) {
        dwdColumnRepository.saveAll(list);
    }

    /**
     * AdsColumn
     */
    public void add(AdsColumn entity) {
        adsColumnRepository.save(entity);
    }

    public void adsColumns(List<AdsColumn> list) {
        adsColumnRepository.saveAll(list);
    }
}